feat(relay): plan-based gating, KV error logging, and request logging#33
feat(relay): plan-based gating, KV error logging, and request logging#33iceteaSA wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
1 issue found across 2 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
5e33a83 to
693b3db
Compare
f381ba8 to
373871d
Compare
e3cc138 to
2e7467c
Compare
There was a problem hiding this comment.
iceteaSA has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
iceteaSA has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
b4939fe to
dec18d3
Compare
There was a problem hiding this comment.
iceteaSA has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
dec18d3 to
6a5b8e6
Compare
There was a problem hiding this comment.
iceteaSA has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
6a5b8e6 to
0f978d5
Compare
There was a problem hiding this comment.
iceteaSA has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
0f978d5 to
0105cae
Compare
There was a problem hiding this comment.
iceteaSA has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
…ging Worker script improvements: - Plan-based gating: WebSocket transport requires paid plan (RELAY_PLAN=paid) - KV error logging: non-429/403 upstream errors logged to KV with 7-day TTL - Request logging: HTTP and WebSocket requests logged on paid plan - GET health endpoint returns plan info and available transports
…ort to plan The worker gates websocket + logging on RELAY_PLAN, but the CLI never set it, so a worker PUT silently reverted to free-plan behaviour. relaySetup now selects the plan (env or prompt, default free) and passes it through uploadRelayWorker as the RELAY_PLAN binding; transport defaults to websocket for paid, http for free.
0105cae to
7823761
Compare
There was a problem hiding this comment.
iceteaSA has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Summary
Relay Worker improvements + a CLI deploy fix so the worker's plan gating actually works.
Worker (
relay.tsWORKER_SCRIPT)RELAY_PLANenv binding:paidenables WebSocket transport + structured logging; otherwise the worker stays HTTP-only (WS upgrades return 403) to fit the free-tier CPU budget.CLI deploy (
cli.ts)relaySetupnow selects the plan —RELAY_PLAN/CLOUDFLARE_PLANenv, else prompt (defaultfree, the safe option for any account) — and passes it through.uploadRelayWorkersets theRELAY_PLANbinding on every deploy. A workerPUTreplaces all bindings, so without this the worker silently reverted to free-plan behaviour on redeploy.transportnow matches the plan (websocketfor paid,httpfor free).Tests
cli.test.tsasserts the relay-setup deploy carries theRELAY_PLANbinding and selects the matching transport.relay-worker-miniflare.test.tscovers the gated worker behaviour.